package concurrency;

public class Sync extends Thread {
	private static int x;

	public static synchronized void doThings() {
		int current = x;
		current++;
		x = current;
	}

	public void run() {
		doThings();
		System.out.println(x);
	}
	
	public static void main(String[] args) {
		new Sync().start();
	}
}
